Spring Boot + Maven API for querying a cve_stage.sqlite database with:
- prepared statements for all SQL execution
- Swagger UI / OpenAPI docs
- Docker support
- endpoints against both staged raw JSON and normalized CVE tables
GET /api/healthGET /api/cves/{cveId}/summaryGET /api/cves/{cveId}/rawGET /api/cves/{cveId}/referencesGET /api/cves/{cveId}/affected-versionsGET /api/cwes/{cweId}/summaries?limit=100&offset=0GET /api/search/descriptions?term=chromePOST /api/query
After startup:
- Swagger UI:
http://localhost:8080/swagger-ui.html - OpenAPI JSON:
http://localhost:8080/v3/api-docs - Grouped OpenAPI JSON:
http://localhost:8080/v3/api-docs/cve-api
Edit src/main/resources/application.properties or pass environment variables:
app.sqlite.path=/absolute/path/to/cve_stage.sqlite
app.sqlite.read-only=true
server.port=8080mvn spring-boot:runmvn clean package
java -jar target/cve-sqlite-api.jardocker build -t cve-sqlite-api:latest .Mount your SQLite DB file into the container and point the app at it:
docker run --rm -p 8080:8080 -e APP_SQLITE_PATH=/data/cve_stage.sqlite -e APP_SQLITE_READ_ONLY=true -v /absolute/path/to/your/db-directory:/data:ro cve-sqlite-api:latestactual:
docker run --rm -p 8080:8080 -e APP_SQLITE_PATH=/data/cve_stage.sqlite -e APP_SQLITE_READ_ONLY=false -v /home/jordan/db:/data cve-sqlite-api:latest
curl http://localhost:8080/api/health
curl http://localhost:8080/api/cves/CVE-2026-3538/summary
curl http://localhost:8080/api/cves/CVE-2026-3538/raw
curl "http://localhost:8080/api/cwes/CWE-209/summaries?limit=25&offset=0"curl -X POST http://localhost:8080/api/query -H 'Content-Type: application/json' -d '{
"template": "CVES_BY_CWE",
"params": {
"cweId": "CWE-209",
"limit": 25,
"offset": 0
}
}'- The generic query endpoint is intentionally restricted to approved query templates rather than raw arbitrary SQL.
- That keeps the service safely parameterized even when callers supply filter values.
This project uses:
- Spring Boot 4.0.3
- springdoc-openapi 3.0.2
If you use springdoc 2.x with Spring Boot 4.x, Swagger UI initialization can fail at startup due to the Spring Boot 3 vs 4 compatibility split.